<template>
    <div class="home-container">
        <h3>Home 组件</h3>
        <hr/>
<!--        this.$router.push('hash地址')   跳转指定hash地址，并增加一条历史记录-->
<!--        this.$router.replace('hash地址')   跳转指定hash地址，替换当前的历史记录
            this.$router.go(数值n)
-->
        <button @click="goTo">通过push跳转到洛基页面</button>
        <button @click="goTo1">通过replace跳转到洛基页面</button>
        <hr/>
        <router-link to="/main">跳转后台主页</router-link>
    </div>
</template>

<script>
export default {
    name: 'Home',
    methods: {
        goTo() {
            // 调用编程式导航api，跳转指定的页面
            this.$router.push('/movie/1')
        },
        goTo1() {
            this.$router.replace('/movie/2')
        },

    }
}
</script>

<style lang="less" scoped>
.home-container {
  min-height: 200px;
  background-color: pink;
  padding: 15px;
}
</style>
